#ifndef _VALIDATOR_H_
#define _VALIDATOR_H_
#include "ValidatorBase.h"
#include "MgrBase.h"
#include "SimpleRefection.h"
struct EventArgBase;
class CombatSessionImp;
class CombatObj;
class Reactor;

class Validator:public ReflectionBase
{
	DECL_REFLECTION(Validator,"../../config/Validator.xml");
public:
	bool Validate(Reactor * pReactor,EventArgBase& rEventArg) const ;
	double m_fRate;
	int32 m_iID;
	std::string m_sDisplayName;
	int32 m_iVSkill;
	int32 m_iVOwner;
	int32 m_iVOther;
	int32 m_iVSrc;
	int32 m_iVEach;
	int32 m_iVContext;
	ETriple m_tiOwnerAsSender;
	ETriple m_tiOtherAsSender;
	rewrite virtual void OnArchieveReaded();
private:
	bool ValidateContext(uint8 iPlayerID,CombatSessionImp * pContext) const ;
	bool ValidateOwner(CombatObj * pOwner) const ;
	bool ValidateOther(CombatObj * pOwner) const ;
	bool ValidateSrc(CombatObj * pOwner) const ;
	bool ValidateEach(CombatObj * pOwner,CombatObj * pTarget) const ;
	bool ValidateSkill(const Reactor * pRecator) const;
	bool ValidateRate(Reactor * pReactor ) const;

	const TSkillValidators* m_pSkillValidators;
	const TObjValidators* m_pObjValidatorsOwner;
	const TObjValidators* m_pObjValidatorsOther;
	const TObjValidators* m_pObjValidatorsSrc;

	const TEachValidators* m_pEachValidators;
	const TContextValidators* m_pContextValidators;

	
};
typedef DefMangerTpl<Validator>  ValidatorManager;

#endif